Skip to content

Handle errors when fetching the raw /Metadata (issue 14305) #14340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2021

Conversation

Snuffleupagus
Copy link
Collaborator

Currently the Catalog.metadata getter only handles errors during parsing, however in a corrupt PDF document fetching of the raw /Metadata can obviously fail as well.
Without this patch the PDFDocumentProxy.getMetadata method, in the API, can thus fail which it never should and this will cause the viewer to not initialize all state as expected.

Fixes one of the documents in issue #14305.

Currently the `Catalog.metadata` getter only handles errors during parsing, however in a *corrupt* PDF document fetching of the raw /Metadata can obviously fail as well.
Without this patch the `PDFDocumentProxy.getMetadata` method, in the API, can thus fail which it *never* should and this will cause the viewer to not initialize all state as expected.

Fixes one of the documents in issue 14305.
@Snuffleupagus
Copy link
Collaborator Author

/botio unittest

@pdfjsbot
Copy link

pdfjsbot commented Dec 4, 2021

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/31b200a25d0b65d/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 4, 2021

From: Bot.io (Windows)


Received

Command cmd_unittest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/c5dea26a99f3564/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Dec 4, 2021

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/31b200a25d0b65d/output.txt

Total script time: 2.98 mins

  • Unit Tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Dec 4, 2021

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/c5dea26a99f3564/output.txt

Total script time: 5.52 mins

  • Unit Tests: Passed

@timvandermeij timvandermeij merged commit 3117985 into mozilla:master Dec 4, 2021
@timvandermeij
Copy link
Contributor

Nice find!

@Snuffleupagus Snuffleupagus deleted the Metadata-fetch-error branch December 4, 2021 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants